﻿using Microsoft.Office.Tools.Ribbon;
using Excel = Microsoft.Office.Interop.Excel;

namespace m_pricelist
{
    public partial class MarelRibbon 
    {
        private void MarelRibbon_Load(object sender, RibbonUIEventArgs e)
        {

        }

        private void ButtonQuote_Click(object sender, RibbonControlEventArgs e)
        {
            QuoteForm quoteForm = new QuoteForm();
            quoteForm.Show();
        }

        private void OpenProposal_Click(object sender, RibbonControlEventArgs e)
        {
                Proposal proposal = new Proposal();
                proposal.Show();          
        }

        private void QuoteServiceProduct_Click(object sender, RibbonControlEventArgs e)
        {
            ServiceProductForm spf = new ServiceProductForm();
            spf.Show();
        }

        //private void FreightConifguration_Click(object sender, RibbonControlEventArgs e)
        //{
        //    FreightConfigurationForm fcf = new FreightConfigurationForm();
        //    fcf.Show();
        //}

        private void priceListTemplate_Click_1(object sender, RibbonControlEventArgs e)
        {
            //string workbookPath = @"C:\Program Files (x86)\Marel\Marel Pricelist 2H 2012\Marel Pricelist.xltm";
            string workbookPath = @"C:\LocalData\Marel\Marel Pricelist 2H 2013\Marel Pricelist.xlsm"; //Þetta er 2013 slóðin - Nýja
            Excel.Workbook workbook = Globals.ThisAddIn.Application.ActiveWorkbook;
            workbook = Globals.ThisAddIn.Application.Workbooks.Open(workbookPath);
        }

        private void CDprojects_Click(object sender, RibbonControlEventArgs e)
        {
            string workbookPath = @"C:\Program Files (x86)\Marel\Marel Project\Marel Project.xltm";
            Excel.Workbook workbook = Globals.ThisAddIn.Application.ActiveWorkbook;
            workbook = Globals.ThisAddIn.Application.Workbooks.Open(workbookPath);
        }

        private void ServiceTemplate_Click(object sender, RibbonControlEventArgs e)
        {
            string workbookPath = @"C:\Program Files (x86)\Marel\Marel Service\Marel Service.xltm";
            Excel.Workbook workbook = Globals.ThisAddIn.Application.ActiveWorkbook;
            workbook = Globals.ThisAddIn.Application.Workbooks.Open(workbookPath);
        }

        private void cmdFreightConfig_Click(object sender, RibbonControlEventArgs e)
        {
            FreightConfigurationForm fcf = new FreightConfigurationForm();
            fcf.Show();
        }     
    }
}
